package cn.zjutleo.village_server.mapper;

import cn.zjutleo.village_server.entity.DepartmentMember;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: 张坤
 * @DateTime: 2021/8/30 23:00
 * @Description: 该类用于 TODO
 */
public interface DepartmentMemberMapper {
    @Select("select department_member.*,user.u_true_name\n" +
            "from department_member,user\n" +
            "where dm_department_id=#{dm_department_id} and user.u_id=department_member.dm_user_id\n")
    @Results(id="Base_departmentMember_data",value = {
            @Result(property = "dm_department_id",  column = "dm_department_id",id = true),
            @Result(property = "dm_user_id",  column = "dm_user_id",id = true),
            @Result(property = "dm_role_id",  column = "dm_role_id"),
            @Result(property = "dm_member_intro",  column = "dm_member_intro"),
            @Result(property = "dm_join_time",  column = "dm_join_time"),
            @Result(property = "dm_true_name",  column = "u_true_name"),
    })
    List<DepartmentMember> searchDepartmentMemberById(Integer dm_department_id);
}
